package com.mocchira.music.radio;

import com.google.ads.AdRequest;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;

public class RankingTabActivity extends TabActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.hot);

        TabHost tabHost = getTabHost();  // The activity TabHost
        TabHost.TabSpec spec;  // Resusable TabSpec for each tab
        Intent intent;  // Reusable Intent for each tab
        Bundle bundle;

        // Create an Intent to launch an Activity for the tab (to be reused)
        intent = new Intent().setClass(this, RankingActivity.class);
        bundle = new Bundle();
        bundle.putString(R.string.bundle_ranking+"", RankingActivity.RESION.am.name());
        intent.putExtras(bundle);

        // Initialize a TabSpec for each tab and add it to the TabHost
        spec = tabHost.newTabSpec("am").setIndicator("America")
                      .setContent(intent);
        tabHost.addTab(spec);

        // Do the same for the other tabs
        intent = new Intent().setClass(this, RankingActivity.class);
        bundle = new Bundle();
        bundle.putString(R.string.bundle_ranking+"", RankingActivity.RESION.ar.name());
        intent.putExtras(bundle);
        spec = tabHost.newTabSpec("ar").setIndicator("Asia and Russia")
                      .setContent(intent);
        tabHost.addTab(spec);

        intent = new Intent().setClass(this, RankingActivity.class);
        bundle = new Bundle();
        bundle.putString(R.string.bundle_ranking+"", RankingActivity.RESION.eu.name());
        intent.putExtras(bundle);
        spec = tabHost.newTabSpec("eu").setIndicator("Europe")
                      .setContent(intent);
        tabHost.addTab(spec);
        
        intent = new Intent().setClass(this, RankingActivity.class);
        bundle = new Bundle();
        bundle.putString(R.string.bundle_ranking+"", RankingActivity.RESION.ot.name());
        intent.putExtras(bundle);
        spec = tabHost.newTabSpec("ot").setIndicator("Others")
                      .setContent(intent);
        tabHost.addTab(spec);

        tabHost.setCurrentTab(0);
        
        //AdRequest request = new AdRequest();
        //request.addTestDevice(AdRequest.TEST_EMULATOR);
        
    }

}
